package qianfeng.com.fan_shu_xiao_bao.view;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import qianfeng.com.fan_shu_xiao_bao.view.base.BaseFragment;

/**
 * Created by Li_ke on 2017/1/16.
 * 主页的多页适配器
 */
public class Main_ViewPager_Adapter extends FragmentPagerAdapter{
    private final BaseFragment[] fragments;

    public Main_ViewPager_Adapter(FragmentManager fm, BaseFragment[] fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }
}
